package com.bkhc.common.enu;

/**
 * @author pcq
 */

public enum AcountTypeEnum {
    Employee(1, "员工"), Partner(2, "伙伴"), Customer(2, "顾客");
    // 成员变量
    private String name;

    private int code;
    // 构造方法
    private AcountTypeEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getName(int code) {
        for (AcountTypeEnum c : AcountTypeEnum.values()) {
            if (c.getCode() == code) {
                return c.name;
            }
        }
        return null;
    }

    public static AcountTypeEnum getAcountTypeEnum(String name) {
        for (AcountTypeEnum c : AcountTypeEnum.values()) {
            if (c.getName() == name) {
                return c;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

}
